#ifndef STLREADER_H
#define STLREADER_H

#include <QFile>
#include <QTextStream>
#include <QDataStream>
#include <QVector>
#include <QVector3D>
#include <QDebug>

#include "ModelFormation.h"

struct Head {
    char partName[80]; // 零件名称
    quint32 faceNum;    // 面的数目
};

enum STL_READ_TYPE
{
    BINARY,
    ASCII
};

class STLReader
{
public:
    STLReader() = default;
    bool readMeshesFromSTLFile(const QString& stl_file_path, STL_READ_TYPE stl_read_type);
    QVector<Mesh> getModelMeshes() const;
protected:
    QVector<Mesh> readAsciiStlFile(const QString &filePath);
    QVector<Mesh> readBinaryStlFile(const QString &filePath);
private:
    QVector<Mesh> m_stlModelMeshs;
};
#endif // STLREADER_H
